package com.gears_software.bbnetwork.views;

import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById;

import android.content.Context;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.gears_software.bbnetwork.R;
import com.gears_software.bbnetwork.datas.models.RecommendRewardzModel;

@EViewGroup(R.layout.item_rewardz)
public class RewardzItemView extends RelativeLayout {

	@ViewById
	TextView txt_name;//推荐人名称
	
	@ViewById
	TextView txt_date;//推荐时间
	
	@ViewById
	TextView txt_renzhengjiangli;//认证奖励
	
	@ViewById
	TextView txt_renzhengtype;//认证奖励提取状态
	
	@ViewById
	TextView txt_shoutuijiangli;//首推奖励
	
	@ViewById
	TextView txt_shoutuitype;//首推奖励提取状态
	
	public RewardzItemView(Context context) {
		super(context);
	}
	
	public void bind(RecommendRewardzModel model){
		if(model!=null){
			txt_name.setText(model.getBeRecommendUserName());
			txt_date.setText(model.getRegistDate());
			txt_renzhengjiangli.setText("￥"+model.getReward());
			txt_shoutuijiangli.setText("￥"+model.getRecommendCut());
			if(model.getIsRewardDraw()!=null){
				if(model.getIsRewardDraw().equals("0")){
					txt_renzhengtype.setText("未提取");
				}else{
					txt_renzhengtype.setText("已提取");
				}
			}
			if(model.getIsRecommendCutDraw()!=null){
				if(model.getIsRecommendCutDraw().equals("0")){
					txt_shoutuitype.setText("未提取");
				}else{
					txt_shoutuitype.setText("已提取");
				}
			}
			
		}
	}

}
